package org.example.bus.bean;


import java.util.ArrayList;
import java.util.List;

/**
 * 流程图节点步骤类
 */
public class WorkFlowNode {

    private String name;

    private Integer type;

    private List<String> nextNodesName;


    /**
     * 直接分配任务
     */
    private String assignee;

    /**
     * 分配给一组候选人
     */
    private String candidateUsers;

    /**
     * 进入该节点的条件
     */
    private String entryCondition;

    public WorkFlowNode(String name, Integer type, String assignee, String candidateUsers, String entryCondition) {
        this.name = name;
        this.type = type;
        this.assignee = assignee;
        this.candidateUsers = candidateUsers;
        this.entryCondition = entryCondition;
    }

    public WorkFlowNode(String name, Integer type, List<String> nextNodesName,  String assignee, String candidateUsers, String entryCondition) {
        this.name = name;
        this.type = type;
        this.nextNodesName = nextNodesName;
        this.assignee = assignee;
        this.candidateUsers = candidateUsers;
        this.entryCondition = entryCondition;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public List<String> getNextNodesName() {
        return nextNodesName;
    }

    public void setNextNodesName(List<String> nextNodesName) {
        this.nextNodesName = nextNodesName;
    }

    public String getAssignee() {
        return assignee;
    }

    public void setAssignee(String assignee) {
        this.assignee = assignee;
    }

    public String getCandidateUsers() {
        return candidateUsers;
    }

    public void setCandidateUsers(String candidateUsers) {
        this.candidateUsers = candidateUsers;
    }

    public String getEntryCondition() {
        return entryCondition;
    }

    public void setEntryCondition(String entryCondition) {
        this.entryCondition = entryCondition;
    }

    public WorkFlowNode addNextNodeName(String nodeName){
        if(this.nextNodesName == null){
            this.nextNodesName =new ArrayList<>();
        }
        this.nextNodesName.add(nodeName);
        return this;
    }
}
